import request from '@/config/axios'

export interface QualificationVO {
  id: number
  major: number
  studentNumber: number
  studentName: string
  studentClass: string
  qualificationName: string
  awardingAuthority: string
  awardDate: Date
  remark: string
  status: number
  reason: string
}

// 查询资格证书列表
export const getQualificationPage = async (params) => {
  return await request.get({ url: `/data/qualification/page`, params })
}

// 查询资格证书详情
export const getQualification = async (id: number) => {
  return await request.get({ url: `/data/qualification/get?id=` + id })
}

// 新增资格证书
export const createQualification = async (data: QualificationVO) => {
  return await request.post({ url: `/data/qualification/create`, data })
}

// 修改资格证书
export const updateQualification = async (data: QualificationVO) => {
  return await request.put({ url: `/data/qualification/update`, data })
}

// 修改资格证书
export const updateQualificationStatus = async (data: QualificationVO) => {
  return await request.put({ url: `/data/qualification/updateStatus`, data })
}

// 删除资格证书
export const deleteQualification = async (id: number) => {
  return await request.delete({ url: `/data/qualification/delete?id=` + id })
}

// 导出资格证书 Excel
export const exportQualification = async (params) => {
  return await request.download({ url: `/data/qualification/export-excel`, params })
}
